<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>


<form action="" method="post">
	<input type="text" name="num1">
	<select name="calcu" id="">
		<option value="+">+</option>
		<option value="-">-</option>
		<option value="*">*</option>
		<option value="/">/</option>
	</select>
	<input type="text" name="num2">
	<input type="submit" >

</form>
	<?php
// echo "Hello world";
// echo "</br>";
// echo PHP_VERSION; //显示PHP版本 
// 	echo PHP_OS;
// var_dump($_POST);
	@$num1=$_POST["num1"];
	@$num2=$_POST["num2"];
	// var_dump($num1);
	// var_dump($_POST["calcu"]);
	@$calcu=$_POST["calcu"];
	$res="";
	if($num1&&$num2){
		switch ($calcu) {
			case '+':
				$res = $num1 + $num2;
				break;
			case '/':
				$res = $num1 / $num2;
				break;
			case '*':
				$res = $num1 * $num2;
				break;
			case '-':
				$res = $num1 - $num2;
				break;
		}
	}
	echo "</br>";
	echo $res;
	$a=["北极","南极","北极熊","企鹅"];
	var_dump($a);
?>
</body>
</html>

